/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.fsiebert.polytech.db.mediatheque.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Florent
 */
@Embeddable
public class AdherentSoldeComptePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "NoCarte", nullable = false)
    private int noCarte;
    @Basic(optional = false)
    @NotNull
    @Column(name = "SoldeCompte", nullable = false)
    private int soldeCompte;

    public AdherentSoldeComptePK() {
    }

    public AdherentSoldeComptePK(int noCarte, int soldeCompte) {
        this.noCarte = noCarte;
        this.soldeCompte = soldeCompte;
    }

    public int getNoCarte() {
        return noCarte;
    }

    public void setNoCarte(int noCarte) {
        this.noCarte = noCarte;
    }

    public int getSoldeCompte() {
        return soldeCompte;
    }

    public void setSoldeCompte(int soldeCompte) {
        this.soldeCompte = soldeCompte;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) noCarte;
        hash += (int) soldeCompte;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AdherentSoldeComptePK)) {
            return false;
        }
        AdherentSoldeComptePK other = (AdherentSoldeComptePK) object;
        if (this.noCarte != other.noCarte) {
            return false;
        }
        if (this.soldeCompte != other.soldeCompte) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "eu.fsiebert.polytech.db.mediatheque.entity.AdherentSoldeComptePK[ noCarte=" + noCarte + ", soldeCompte=" + soldeCompte + " ]";
    }
    
}
